Skip to content

Fix for issue https://github.com/prestodb/presto-maven-plugin/issues/1#11

Merged
wanglinsong merged 1 commit into
prestodb:masterfrom
Megaprog:bug-windows-compatibility
Feb 22, 2023
Merged

Fix for issue https://github.com/prestodb/presto-maven-plugin/issues/1#11
wanglinsong merged 1 commit into
prestodb:masterfrom
Megaprog:bug-windows-compatibility

Conversation

@Megaprog
Copy link
Copy Markdown
Contributor

@Megaprog Megaprog commented Dec 16, 2018

replaced slash by File.separateChar

CheckerIntegrationTest works under Windows now

#1

 replaced slash by File.separateChar
@dnskr
Copy link
Copy Markdown

dnskr commented Jan 17, 2023

The PR allows to build Presto on Windows because it fixes the following issue:

[INFO] --- presto-maven-plugin:0.4:generate-service-descriptor (default-generate-service-descriptor) @ presto-tpch ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.863 s
[INFO] Finished at: 2023-01-18T00:33:33+01:00
[INFO] ------------------------------------------------------------------------

@rohanpednekar
Copy link
Copy Markdown

@wanglinsong Do you think you can help here?

List<String> classes = FileUtils.getFileNames(classesDirectory, "**/*.class", null, false);
for (String classPath : classes) {
String className = classPath.substring(0, classPath.length() - 6).replace('/', '.');
String className = classPath.substring(0, classPath.length() - 6).replace(File.separatorChar, '.');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaceAll?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wanglinsong No, replace should be used, because it replaces all occurrences:

public String replace(char oldChar, char newChar)
Returns a string resulting from replacing all occurrences of oldChar in this string with newChar.

while replaceAll works with regular expressions.

But I agree that it's confusing naming.

Copy link
Copy Markdown
Member

@wanglinsong wanglinsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rohanpednekar
Copy link
Copy Markdown

Thanks @wanglinsong

@rongrong Do you think you can help us to merge this PR?

CC @tdcmeehan

@wanglinsong wanglinsong merged commit 30348f6 into prestodb:master Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants